package com.example.models;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.validator.constraints.NotBlank;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

/**
 * Created by Lin on 2016/7/1.
 * 数据库实体类
 * 使用lombok注解方式实现get、set、无参、有参
 */
@Entity
@Table(name = "users")
@Getter @Setter @NoArgsConstructor @AllArgsConstructor
public class User {

    @Id @NotBlank(message = "用户名不能为空")
    private String name;
    @NotNull(message = "密码不能为Null")
    private String pwd;
}
